package slevnik;

import java.sql.SQLException;
import java.util.List;
import javax.sql.DataSource;

/**
 * This class is an interface to manager for items with categories
 * @author Eduard Krak, Martin Penak
 */
public interface ResultManager {
    
    /**
     * Returns datasource of connection
     *
     * @return Datasource of connection
     */
    public DataSource getPool();

    /**
     * Returns list of items which belong to given category
     * @param category category used to filter items
     * @param sortingParam parameter used to order Items
     * @param ascending boolean deciding if to sort ascendingly or descendingly
     * @return list of items selected by category
     * @throws SlevnikException
     */
    public List<Item> findItemsByCategory(Category category, String sortingParam, Boolean ascending) throws SlevnikException;

    /**
     * Returns list of items which belong to given category
     * @param city city used to filter items
     * @param category category used to filter items
     * @param sortingParam parameter used to order Items
     * @param ascending boolean deciding if to sort ascendingly or descendingly
     * @return list of items selected by category
     * @throws SlevnikException
     */
    public List<Item> findItemsByCityAndCategory(String city, Category category, String sortingParam, Boolean ascending) throws SlevnikException;

}
